<template>
  <div>
    <mobile-editor v-if="!isPC"></mobile-editor>
    <markdown-edit v-if="isPC"></markdown-edit>
  </div>
</template>
<script>
  import mobileEditor from '@/components/base/mobileEditor'
  import markdownEdit from '@/components/base/markdownedit'
  export default {
    data() {
      return {
        isPC: true
      }
    },
    components:{
      mobileEditor,markdownEdit
    },
    methods: {
      isPCFun: function () {
        var userAgentInfo = navigator.userAgent;
        var Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPod", "iPad"];
        var flag = true;
        for (var i = 0; i < Agents.length; i++) {
          if (userAgentInfo.indexOf(Agents[i]) > 0) {
            flag = false;
            break;
          }
        }
        this.isPC = flag;

      }
    },
    mounted() {
      this.isPCFun();
    }

  }

</script>
